import java.util.Scanner;
import java.io.FileInputStream;
import java.io.IOException;
public class FileScannerCharRead {
  public static void main(String[] args){
    try{
       FileInputStream instream = new FileInputStream("data.txt");
       Scanner fileScanner = new Scanner(instream);
       fileScanner.useDelimiter("");
       char ch = fileScanner.next().charAt(0);
       System.out.println("The first character read from the file is " + ch);
       ch = fileScanner.next().charAt(0);
       System.out.println("The second character read from the file is " + ch);
       instream.close();
     }catch(IOException e){
         System.err.println(e);
     }
  }
}